package com.example.mapper;

import com.example.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select * from user")
    List<User> getAll();

    @Update("update user set username=#{username},name=#{name},age=#{age},gender=#{gender} where id=#{id}")
    int update(User user);

    @Delete("delete from user where id=#{id}")
    int delete(Integer id);

    @Insert("insert into user(username,name,age,gender) values(#{username},#{name},#{age},#{gender})")
    int insert(User user);

    List<User> getByIds(List<Integer> ids);
}
